#radon construction suite
#local
include ../config_main
include ./../$(CONFINC)
PURESOURCES=libline.c ../sock.c
PURECFLAGS+=-I/usr/include
PURELDFLAGS+=-L/usr/lib
PURESHARED=-shared

BINDCFLAGS+=$(PURECFLAGS) -I/usr/include/toluaxx5.1 -I/usr/include/lua5.1
BINDLDFLAGS+=$(PURELDFLAGS) -ltoluaxx5.1
BINDSHARED=-shared
PXX=libline.pkg
BIND=libline.bind.c
BINDSOURCES=$(PURESOURCES) $(BIND) 

BINDOBJECTS=$(BINDSOURCES:.c=.o)

BINDEXECUTABLE=../libline.so

all: $(BINDEXECUTABLE) $(BIND)

$(BINDEXECUTABLE): $(BINDOBJECTS)
	$(ECHO) "----- Building bind executable -----"
	$(CC) $(BINDSHARED) $(BINDLDFLAGS) $(BINDOBJECTS) -o $@

$(BINDOBJECTS): %.o: %.c
	$(CC) $(BINDCFLAGS) -c $< -o $@

$(BIND): $(PXX)
	$(TXX) -o $(BIND) $(PXX)

.PHONY: clean
clean:
	$(DELETE) $(BIND) $(BINDEXECUTABLE) $(BINDOBJECTS)

